package com.fjnu.javaweb;

class Solution {
    public boolean repeatedSubstringPattern(String s) {
        for(int i = 1; i <= s.length()/2; i++){
            String s1 = s.substring(0,i);
            String result = "";
            while(result.length() < s.length()){
                result = result + s1;
            }
            if(result.equals(s)){
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.repeatedSubstringPattern("abab");
    }
}